import { PhotoProvider, PhotoConsumer } from 'react-photo-view';
import 'react-photo-view/dist/index.css';
import React, { Component } from 'react'

interface IProps {
    src: string
    intro: string
    width?: number
    className?: string
}
export default class ImgView extends Component<IProps> {
    render() {
        const { src, intro, className, ...elseProps } = this.props;
        return (
            <PhotoProvider>
                <PhotoConsumer src={src} intro={intro}>
                    <img className={className} src={src} alt={intro} {...elseProps}/>
                </PhotoConsumer>
            </PhotoProvider>
        )
    }
}